<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('IAM配置')"/>
</head>

<div class="main-content">
    <form class="form-horizontal" th:object="${auth}">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">登录成功跳转url：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext"
                           th:text="${auth.localServer + auth.callbackUrl + '?client_name=' + auth.clientName}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">服务注册serviceId：</label>
                    <div class="col-sm-7">
                        <p th:if="${auth.type == 'SAML'}" class="form-control-plaintext"
                           th:text="${'.*' + auth.clientName + '.*'}"></p>
                        <p th:unless="${auth.type == 'SAML'}" class="form-control-plaintext"
                           th:text="${'.*client_name=' + auth.clientName + '.*'}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" th:if="${auth.type == 'OAUTH2' || auth.type == 'OIDC'}">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">clientId：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext" th:text="*{clientId}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" th:if="${auth.type == 'OAUTH2' || auth.type == 'OIDC'}">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">clientSecret：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext" th:text="*{clientSecret}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" th:if="${auth.type == 'SAML'}">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">应用元数据地址：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext" th:text="${auth.localServer + '/sp/metadata/' + auth.clientName}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" th:if="${auth.type == 'SAML'}">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">登录凭证加签：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext" th:text="${auth.wantsAssertionsSigned == 'N' ? '否' : '是' }"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" th:if="${auth.type == 'SAML'}">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">响应数据加签：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext" th:text="${auth.wantsResponsesSigned == 'N' ? '否' : '是' }"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-sm-4 control-label">单点登出url：</label>
                    <div class="col-sm-7">
                        <p class="form-control-plaintext" th:text="${auth.localServer + '/singleLogout'}"></p>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
</html>
